import pandas as pd

# 将TUKI_DATA和LUKU_DATA >0 的值替换为1"

# 打开DATA_without_NAN.csv文件
data = pd.read_csv('DATA_without_NAN.csv')

# 用1替换TUKI_DATA列中非零值
for i in range(len(data)):
    if(data['TUKI_DATA'][i] != 0):
        data['TUKI_DATA'][i] = 1

# 用1替换LUKU_DATA列中非零值
for i in range(len(data)):
    if(data['LUKU_DATA'][i] != 0):
        data['LUKU_DATA'][i] = 1

# 将dataframe中更改过的数据存入csv
data.to_csv('数据.csv')






